package cn.edu.scau.cmi.hexiaoqing.factoryMethod;


import cn.edu.scau.cmi.hexiaoqing.simpleFactoryMethod.Interface.AutoInsurance;
import cn.edu.scau.cmi.hexiaoqing.simpleFactoryMethod.Interface.BodyInjur;
import cn.edu.scau.cmi.hexiaoqing.simpleFactoryMethod.Interface.Collision;
import cn.edu.scau.cmi.hexiaoqing.simpleFactoryMethod.Interface.Comprehensive;
import cn.edu.scau.cmi.hexiaoqing.simpleFactoryMethod.Interface.PersonInjur;

public class PolicyProducer {

	public static AutoInsurance getInsurance(String Insurance) {
		AutoInsurance policy = null;
		if ("BodyInjur".equals(Insurance)) {
			policy = new BodyInjur();
		} else if ("Collision".equals(Insurance)) {
			policy = new Collision();
		} else if ("Comprehensive".equals(Insurance)) {
			policy = new Comprehensive();
		} else if ("PersonInjur".equals(Insurance)) {
			policy = new PersonInjur();
		}
		return policy;
	}
}
